﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Quiz_Builder.Helpers;

namespace Quiz_Builder.ViewModel.TestTypes
{
    internal class MultipleChoiceTestViewModel : BaseViewModel
    {
        #region Fields
        private ObservableCollection<AnswerRadioItem> _answers;
        #endregion

        #region Properties
        public ObservableCollection<AnswerRadioItem> Answers
        {
            get
            {
                if (_answers == null)
                    _answers = new ObservableCollection<AnswerRadioItem>();
                return _answers;
            }
            set
            {
                _answers = value;
                RaisePropertyChanged("Answers");
            }
        }
        #endregion

        #region Commands

        public ICommand AddNewAnswerCommand { get; set; }
        #endregion

        public MultipleChoiceTestViewModel()
        {
            InitCommands();
        }

        #region Methods
        private void InitCommands()
        {
            AddNewAnswerCommand = new RelayCommand(OnAddNewAnswer);
        }

        private void OnAddNewAnswer(object obj)
        {
           // Answers.Add(new AnswerRadioItem(false, String.Empty));
        }

        #endregion
    }
}
